import pluginVue from 'eslint-plugin-vue'
import { configureVueProject, defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript'
// import pluginVitest from '@vitest/eslint-plugin'
// import pluginPlaywright from 'eslint-plugin-playwright'
import oxlint from 'eslint-plugin-oxlint'

configureVueProject({
  rootDir: import.meta.dirname,
  tsSyntaxInTemplates: true,
  scriptLangs: ['ts', 'tsx'],
})
export default defineConfigWithVueTs(
  pluginVue.configs['flat/essential'],
  vueTsConfigs.recommended,
  {
    name: 'app/files-to-lint',
    files: ['**/*.{ts,tsx,vue}'],
    rules: {
      indent: ['error', 2],
      quotes: ['error', 'single'], // 单引号
      'comma-dangle': ['error', 'always-multiline'], // 对象字面量项尾逗号
      eqeqeq: ['error', 'always'], // 强制使用全等
      'vue/multi-word-component-names': 'off', // 组件名中多个单词
      semi: ["error", "never"], // 结尾 ;
      '@typescript-eslint/no-explicit-any': 'off',
    }
  },
  {
    name: 'app/files-to-ignore',
    ignores: ['**/dist/**', '**/dist-ssr/**', '**/coverage/**', '**/node_modules/**'],
  },

  /*  {
      ...pluginVitest.configs.recommended,
      files: ['src/!**!/__tests__/!*'],
    },

    {
      ...pluginPlaywright.configs['flat/recommended'],
      files: ['e2e/!**!/!*.{test,spec}.{js,ts,jsx,tsx}'],
    },*/
  oxlint.configs['flat/recommended'],
)

